<?php

class GaleriaController extends Zend_Controller_Action{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction(){
        $this->view->headTitle('Galeria');

        $galeriaModel = new Application_Model_Galeria();

        $busca = $this->_request->getParam('busca');
{
            $galeria = $galeriaModel->fetchAll(
                                    $galeriaModel->select()
                                    ->where('descricao LIKE :busca')
                                    ->where('excluido = 0')
                                    ->bind(array(
                                        'busca' => '%' . $busca . '%'
                                    ))
            );
        }
    }
    
    public function visualizarAction() {
        $id = $this->_request->getParam('id');

        $galeriaModel = new Application_Model_Galeria();

        $galeria = $galeriaModel->find($id)->current();

 

        $this->view->galeria = $galeria;


    }

}